<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__static/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="__static/css/public.css" media="all">
    <link rel="stylesheet" href="__static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <style>
        .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
    </style>
</head>
<body>

<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-tab">
            <ul class="layui-tab-title">
              <li class="layui-this">基础配置</li>
              <li>规则设置</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote">
                        <p><i class="fa fa-cog"></i> 基础配置</p>
                    </blockquote>
            
                    <div class="layui-form layuimini-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">网站名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="sitename" placeholder="请输入网站名称"  value="{$data.sitename|default=''}" class="layui-input">
                                <tip>填写自己部署网站的名称。</tip>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">网站域名</label>
                            <div class="layui-input-block">
                                <input type="text" name="domain" placeholder="请输入网站域名"  value="{$data.domain|default=''}" class="layui-input">
                            </div>
                        </div>
            
                        <div class="layui-form-item">
                            <label class="layui-form-label">缓存时间</label>
                            <div class="layui-input-inline" style="width: 80px;">
                                <input type="text" name="expire_time" lay-verify="number" value="{$data.expire_time|default='0'}" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-input-company">分钟</div>
                            <div class="layui-form-mid layui-word-aux">本地开发一般推荐设置为 0，线上环境建议设置为 10。</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">最大文件上传</label>
                            <div class="layui-input-inline" style="width: 80px;">
                                <input type="text" name="max_upload_size" lay-verify="number" value="{$data.max_upload_size|default='2048'}" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-input-company">KB</div>
                            <div class="layui-form-mid layui-word-aux">提示：1 M = 1024 KB</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">上传文件类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="aloow_upload_type" value="{$data.aloow_upload_type|default=''}" class="layui-input">
                                <tip>使用 , 分隔后缀名，例：gif,jpg,png</tip>
                            </div>
                        </div>
            
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">首页标题</label>
                            <div class="layui-input-block">
                                <textarea name="title" class="layui-textarea">{$data.title|default=''}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">META关键词</label>
                            <div class="layui-input-block">
                                <textarea name="keywords" class="layui-textarea" placeholder="多个关键词用英文状态 , 号分割">{$data.keywords|default=''}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">META描述</label>
                            <div class="layui-input-block">
                                <textarea name="description" class="layui-textarea">{$data.description|default=''}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">版权信息</label>
                            <div class="layui-input-block">
                                <textarea name="copyright" class="layui-textarea">{$data.copyright|default=''}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item layui-form layuimini-form">
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">账户完成率</label>
                        <div class="layui-input-block">
                            <input type="radio" name="acc_lv" value="1" title="是" {eq name="data.acc_lv" value="1"}checked=""{/eq}>
                            <input type="radio" name="acc_lv" value="0" title="否" {eq name="data.acc_lv" value="0"}checked=""{/eq}>
                            <tip>是否开启账户完成率，定时跟新，每6小时跟新一次</tip>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">账户完成率规则</label>
                        <div class="layui-col-xs6">
                            <textarea class="layui-textarea" style="height: 280px;" readonly="readonly">
                                //账号完成率			
                                // 评定完成率标准：				
                                // 1.   开户中 ==============================================2%				
                                // 2.   素材已准备完毕等待上传====================================5%				
                                // 3   审核页与投放页面已准备完毕  =================================8%				
                                // 4.   账户创建成功搭建第一阶段素材================================5%				
                                // 5.   账户第一阶段素材已通过搭建第二阶段投放素材=======================10%				
                                // 6.   第二阶段投放素材已通过等待投放===============================30%				
                                // 7.   明确客户KPI需求；账户开始投放===============================5%				
                                // 8.   账户投放达到客户要求=====================================15%				
                                // 9.   账户投放续费5次以上 =====================================10%				
                                // 10. 账户续费10次以上 =======================================10%
                            </textarea>
                        </div>
                    </div>
                    <hr/>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting2">确认保存</button>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
        
        
    </div>
</div>
<script src="__static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form','element'], function () {
        var $ = layui.jquery,element= layui.element,
            form = layui.form,
            layer = layui.layer;

        //监听提交
        form.on('submit(setting)', function (data) {
            // parent.layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // });
            get_save(data.field);
            return false;
        });
        form.on('submit(setting2)', function (data) {
            get_save(data.field);
            return false;
        });
        function get_save(data){
            var url = '/system/base';
            layer.load(2);
            $.post(url, data, function(d) {
                var index = layer.alert(d.msg, '', function() {
                    layer.close(index);
                    // var iframeIndex = parent.layer.getFrameIndex(window.name);
                    // parent.layer.close(iframeIndex);
                });
                layer.closeAll('loading');
            });
        }

    });
</script>
</body>
</html>